package GUI;

import java.awt.event.ActionListener;

import javax.swing.*;

import java.awt.Color;



/**
 * The Class ForgotPasswordGUI extends AbstractGUI class.
 * Boundary for getting a forgotten password activity.
 * @author Ofek-az
 */
public class ForgotPasswordGUI extends AbstractGUI {
	
	/** The ok button. */
	private JButton btnOk;
	
	/** The id text field. */
	private JTextField idTf;
	
	/** The back button. */
	private JButton btnBack;
	
	/**
	 * Instantiates a new forgot password gui.
	 */
	public ForgotPasswordGUI() {
		getContentPane().setBackground(new Color(100, 149, 237));
		initialize();
	}
	
	/* (non-Javadoc)
	 * @see GUI.AbstractGUI#initialize()
	 */
	public void initialize()
	{
		setTitle("Forgot password");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(400,300);
		setLocationRelativeTo(null);
		getContentPane().setLayout(null);
		
		JLabel lblId = new JLabel("ID:");
		lblId.setBounds(89, 60, 47, 14);
		getContentPane().add(lblId);
		
		idTf = new JTextField();
		idTf.setBounds(164, 57, 136, 20);
		getContentPane().add(idTf);
		idTf.setDocument(new JTextFieldLimit(10));
		
		btnOk = new JButton("Ok");
		btnOk.setSelected(true);
		btnOk.setBounds(136, 108, 89, 23);
		getContentPane().add(btnOk);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(10, 228, 89, 23);
		getContentPane().add(btnBack);
	}

	/**
	 * Adds action listener to ok button.
	 *
	 * @param listener the listener
	 */
	public void addOkActionListener(ActionListener listener)
	{
		btnOk.addActionListener(listener);
	}
	
	/**
	 * Adds action listener to back button.
	 *
	 * @param listener the listener
	 */
	public void addBackActionListener(ActionListener listener)
	{
		btnBack.addActionListener(listener);
	}
	
	/**
	 * Gets the id field.
	 *
	 * @return the id field
	 */
	public String getIdField()
	{
		return idTf.getText();
	}
}
